Consider all polynomials of the form
\[x^9 + a_8 x^8 + a_7 x^7 + \dots + a_2 x^2 + a_1 x + a_0,\]where $a_i \in \{0,1\}$ for all $0 \le i \le 8.$  Find the number of such polynomials that have exactly two different integer roots.
Answer: If all the $a_i$ are equal to 0, then the polynomial becomes $x^9 = 0,$ which has only one integer root, namely $x = 0.$  Thus, we can assume that there is some coefficient $a_i$ that is non-zero.  Let $k$ be the smallest integer such that $a_k \neq 0$; then we can take out a factor of $x^k,$ to get
\[x^k (x^{9 - k} + a_8 x^{8 - k} + a_7 x^{7 - k} + \dots + a_{k + 1} x + a_k) = 0.\]By the Integer Root Theorem, any integer root of $x^{9 - k} + a_8 x^{8 - k} + \dots + a_{k + 1} x + a_k = 0$ must divide $a_k = 1,$ so the only possible integer roots are 1 and $-1.$ However, if we plug in $x = 1,$ we see that $x^{9 - k} = 1,$ and all the other terms are nonnegative, so $x = 1$ cannot be a root.

Therefore, for the original polynomial to have two different integer roots, they must be 0 and $-1.$  For 0 to be a root, it suffices to take $a_0 = 0,$ and the polynomial is
\[x^9 + a_8 x^8 + a_7 x^7 + a_6 x^6 + a_5 x^5 + a_4 x^4 + a_3 x^3 + a_2 x^2 + a_1 x = 0.\]We also want $x = -1$ to be a root.  We have that $(-1)^9 = -1,$ so in order for the polynomial to become 0 at $x = -1,$ we must choose some of the $a_i$ to be equal to 1.  Specifically, if $k$ is the number of $i$ such that $a_i = 1$ and $i$ is odd, then the number of $i$ such that $a_i = 1$ and $i$ is even must be $k + 1.$

There are four indices that are odd (1, 3, 5, 7), and four indices that are even (2, 4, 6, 8), so the possible values of $k$ are 0, 1, 2, and 3.
Furthermore, for each $k,$ so the number of ways to choose $k$ odd indices and $k + 1$ even indices is $\binom{4}{k} \binom{4}{k + 1}.$  Therefore, the number of such polynomials is
\[\binom{4}{0} \binom{4}{1} + \binom{4}{1} \binom{4}{2} + \binom{4}{2} \binom{4}{3} + \binom{4}{3} \binom{4}{4} = \boxed{56}.\]